/*
	YoghurtGum - 2D Game Engine

	Copyright 2009-2010 Quinten Lansu
	
	Licensed under the Apache License, Version 2.0 (the "License"); you may not 
	use this file except in compliance with the License. You may obtain a copy 
	of the License at 
		
		http://www.apache.org/licenses/LICENSE-2.0 
		
	Unless required by applicable law or agreed to in writing, software 
	distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
	License for the specific language governing permissions and limitations 
	under the License. 
*/

#ifndef _SPRITEEXDIRECTDRAW_H_
#define _SPRITEEXDIRECTDRAW_H_

#include "RenderMethodDirectDraw.h"
#include "YGColor.h"
#include "YGVec2.h"

namespace YoghurtGum
{

	class SpriteExDirectDraw : public SpriteEx
	{

	public:

		SpriteExDirectDraw(float a_Delay);
		~SpriteExDirectDraw();

		bool SetData(ImageData* a_Data);

		void SetCenter(int a_X, int a_Y);

		void Scale(float a_RatioX, float a_RatioY);
		void Rotate(float a_Degrees);

		void Draw(float a_X, float a_Y, int a_Frame = -1, float a_Depth = 0.f);

		void PrevFrame();
		void NextFrame();

		Surface* ToSurface(int a_Frame = -1);

	private:

		LPDIRECTDRAWSURFACE m_Frames;
		RECT m_Dimensions;

		int m_SpriteWidth, m_SpriteHeight;
		int m_CenterX, m_CenterY;
		float m_Rotation;
		float m_ScaleX, m_ScaleY;

		LPDIRECTDRAWSURFACE m_TargetSurface;
		LPDIRECTDRAW m_TargetObject;
		
	}; // class SpriteExDirectDraw

}; // namespace YoghurtGum

#endif